link-grpc
authorLLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>
Mon, 26 Dec 2022 16:50:24 +0000 (16:50 +0000)
committerSylvestre Ledru <sylvestre@debian.org>
Mon, 26 Dec 2022 16:50:24 +0000 (16:50 +0000)
===================================================================

Gbp-Pq: Name link-grpc.diff

llvm/cmake/modules/FindGRPC.cmake

index e058f544cb290b1566f632fd9983d81ac13254b0..f177170d5323ba28e96b3da7d3ce76a89546e834 100644 (file)
@@ -73,10 +73,27 @@ else()
       endif()
     endif()
   endif()
+
+  find_library(GPR_LIBRARY gpr $GRPC_OPTS REQUIRED)
+  add_library(gpr UNKNOWN IMPORTED GLOBAL)
+  message(STATUS "Using gpr: " ${GPR_LIBRARY})
+  set_target_properties(gpr PROPERTIES IMPORTED_LOCATION ${GPR_LIBRARY})
+
   find_library(GRPC_LIBRARY grpc++ $GRPC_OPTS REQUIRED)
   add_library(grpc++ UNKNOWN IMPORTED GLOBAL)
   message(STATUS "Using grpc++: " ${GRPC_LIBRARY})
   set_target_properties(grpc++ PROPERTIES IMPORTED_LOCATION ${GRPC_LIBRARY})
+
+  find_library(GRPC2_LIBRARY grpc $GRPC_OPTS REQUIRED)
+  add_library(grpc UNKNOWN IMPORTED GLOBAL)
+  message(STATUS "Using grpc: " ${GRPC2_LIBRARY})
+  set_target_properties(grpc PROPERTIES IMPORTED_LOCATION ${GRPC2_LIBRARY})
+
+  find_library(ABSL_SYNCHRONIZATION_LIBRARY absl_synchronization $GRPC_OPTS REQUIRED)
+  add_library(absl_synchronization UNKNOWN IMPORTED GLOBAL)
+  message(STATUS "Using absl_synchronization: " ${ABSL_SYNCHRONIZATION_LIBRARY})
+  set_target_properties(absl_synchronization PROPERTIES IMPORTED_LOCATION ${ABSL_SYNCHRONIZATION_LIBRARY})
+
   if (ENABLE_GRPC_REFLECTION)
     find_library(GRPC_REFLECTION_LIBRARY grpc++_reflection $GRPC_OPTS REQUIRED)
     add_library(grpc++_reflection UNKNOWN IMPORTED GLOBAL)
@@ -123,7 +140,7 @@ function(generate_protos LibraryName ProtoFile)
 
   add_clang_library(${LibraryName} ${GeneratedProtoSource}
     PARTIAL_SOURCES_INTENDED
-    LINK_LIBS PUBLIC grpc++ protobuf)
+    LINK_LIBS PUBLIC protobuf gpr grpc absl_synchronization grpc++)
 
   # Ensure dependency headers are generated before dependent protos are built.
   # DEPENDS arg is a list of "Foo.proto". While they're logically relative to